using System;
using FluentNHibernate.Automapping;
using FluentNHibernate.Automapping.Alterations;
using MvcMall.Core.Domains;
using MvcMall.Core.Enums;

namespace MvcMall.Data.NHibernateMaps
{
    public class GoodsCategoryAttributeMap : IAutoMappingOverride<GoodsCategoryAttribute>
    {
        public void Override(AutoMapping<GoodsCategoryAttribute> mapping)
        {
            mapping.Table("GoodsCategoryAttributes");
            mapping.Id(c => c.Id).Column("AttrId");
            mapping.Map(c => c.AttrInputType).CustomType(typeof(AttrInputType));
            mapping.Map(c => c.AttrType).CustomType(typeof(AttrType));

            mapping.References(c => c.GoodsCategory).Column("GoodsCategoryId");

        }
    }
}